﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using CCWin;
using BLL;
using BookModel;

namespace WinFromBook
{
    public partial class FrmReaderInfo : CCSkinMain
    {
        public FrmReaderInfo()
        {
            InitializeComponent();
        }
        borrowerIfnoBLL bll = new borrowerIfnoBLL();
        private void FrmReaderInfo_Load(object sender, EventArgs e)
        {
            selectborrwer();
        }
        //加载所有赔偿信息
        public void selectborrwer()
        {
            List<borrowerIfno> list = bll.selectborrwer();
            this.skinDataGridView1.DataSource = list.ToList();
        }
        //根据编号查询信息
        private void buttSlect_Click(object sender, EventArgs e)
        {
            if ((this.textRead.Text == ""))
            {
                MessageBox.Show("不能为空，输入有效数字", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            List<borrowerIfno> list = bll.selectBorr(Convert.ToInt32(this.textRead.Text));
            this.skinDataGridView1.DataSource = list.ToList();
        }

        private void 修改赔偿记录ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmUndefined fu = new FrmUndefined();
            fu.Fr = this;
            fu .BorrowerID=int .Parse (this .skinDataGridView1.SelectedRows[0].Cells[0].Value.ToString());
            fu.Show();
        }
    }
}
